#
#  Setup darkserver packages
#

- name: setup darkserver
  dnf: name={{ item }} state=present
  with_items:
    - darkserver-importer
  notify:
  - restart fedmsg-hub

# Use this to make stg darkserver listen to the prod bus.
#- name: install a loopback so we listen to the prod fedmsg bus (only in staging)
#  copy: src=loopback.py dest=/etc/fedmsg.d/loopback.py
#  notify: restart fedmsg-hub
#  when: env == 'staging'

- name: email.json file
  copy: src=email.json dest=/etc/darkserver/email.json owner=root group=root mode=0644

- name: darkjobworker.conf
  template: src=darkjobworker.conf.j2 dest=/etc/darkserver/darkjobworker.conf owner=root group=root mode=640
  notify: restart darkserver


